package com.example.javaeekeshe.mapper;

import com.example.javaeekeshe.pojo.AddressBean;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AddressMapper {
    @Select("select * from address where uid = #{id}")
    public List<AddressBean> selectByUId(Integer id);

    @Delete("delete from address where id = #{id}")
    public void delAddressByid(Integer id);

    @Insert("insert into address (uid,address,phone,name) values(#{uid},#{address},#{phone},#{name})")
    public void addAddress(AddressBean address);

    @Select("select * from address where id = #{id}")
    public AddressBean selectAddressByid(Integer id);

    @Update("UPDATE address SET name = #{name},address = #{address},phone =#{phone} WHERE id = #{id}")
    public void update(AddressBean addressBean);
}
